import 'package:bruno/bruno.dart';
import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../../AppConfig/Config.dart';
import '../../AppConfig/LocalStorage.dart';
import '../../AppConfig/RouteAct.dart';
import '../../Order/EvaluationPage.dart';
import '../../http/NoLoadingGetApi.dart';
import '../../l10n/messages.dart';

class MyEvaluation extends StatefulWidget {
  const MyEvaluation({super.key, required this.userMap});
  final Map userMap;
  @override
  State<MyEvaluation> createState() => _MyEvaluationState();
}

class _MyEvaluationState extends State<MyEvaluation> {

  int isCheck=0;
  List<String> tagList = [
    '全部',
    '好评',
    '中评',
    '差评',
  ];
  int myEvaTag=0;
  int pageNum=1;
  List dataList=[];

  void onReachBottom() {
    setState(() {
      pageNum=pageNum+1;
      if(isCheck==0){
        getUnEvaluationAct();
      }else if(isCheck==1){
        getMyEvaluationAct();
      }else{
        getShipperEvaluationAct();
      }
    });

    // 在这里可以执行加载更多数据的逻辑
  }
  Future _onRefresh() async {
    setState(() {
      pageNum=1;
    });
    if(isCheck==0){
      getUnEvaluationAct();
    }else if(isCheck==1){
      getMyEvaluationAct();
    }else{
      getShipperEvaluationAct();
    }

  }
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    getUnEvaluationAct();
  }
  void getShipperEvaluationAct()async{

    String? driverId=await UserIdManager.getUserID();
    NoLoadinggetApiManager.getData(
      context,
      "api/auth/shipper/evaluation/page",
      {"current":pageNum,"size":20,"driverId":driverId,
        "level":myEvaTag==1?"POSITIVE":myEvaTag==2?"NEUTRAL":myEvaTag==3?"NEGATIVE":"",
      },
          (responseData)  {
        setState(() {
          dataList=responseData['data']['records'];
        });
      },
    );
  }
  void getMyEvaluationAct()async{
    String? driverId=await UserIdManager.getUserID();
    NoLoadinggetApiManager.getData(
      context,
      "api/auth/driver/evaluation/page",
      {"current":pageNum,"size":20,"driverId":driverId,
        "level":myEvaTag==1?"POSITIVE":myEvaTag==2?"NEUTRAL":myEvaTag==3?"NEGATIVE":"",
      },
          (responseData)  {
        setState(() {
          dataList=responseData['data']['records'];
        });
      },
    );
  }
  void getUnEvaluationAct()async{
    NoLoadinggetApiManager.getData(
      context,
      'api/waybill/driver/waybill/page',
      {
        "pageNum":pageNum,
        "pageSize":20,
        "category":3,
      },
          (responseData) {
        setState(() {
          if(pageNum==1){
            dataList = responseData['data']['records'];
          }else {
            if(responseData['data']['records'].isNotEmpty) {
              dataList.add(responseData['data']['records']);
            }else{
              pageNum=pageNum-1;
            }
          }
        });
      },
    );
  }
  @override
  Widget build(BuildContext context) {
    final screenSize = MediaQuery.of(context).size;
    var messages = AppLocalizations.of(context)!;
    return Scaffold(
      backgroundColor: MyColors.backgreyColor,
      appBar: AppBar(
        leading: IconButton(icon: Icon(Icons.arrow_back_ios,color: Colors.black,),onPressed: (){Navigator.pop(context);},),
        backgroundColor: Colors.white,
        centerTitle: true,
        title: Text(messages["我的评价"],style: TextStyle(color: Colors.black,fontWeight: FontWeight.w300,fontSize: 16.sp),),
      ),
      body: ListView(
        children: [
          SizedBox(height: 8.h,),
          Container(
            color: Colors.white,
            child: Column(
              children: [
                SizedBox(height: 10.h,),
                Row(
                  children: [
                    SizedBox(width: 10.w,),
                    Container(
                      decoration: BoxDecoration(
                          color: Colors.white,
                          borderRadius: BorderRadius.all(Radius.circular(10))),
                      child: ClipOval(
                        child: widget.userMap['avatarPath']!=""&&widget.userMap['avatarPath']!=null?Image.network(
                          MyServiceUrl.imgHeader + widget.userMap['avatarPath'],
                          width: 36.w,
                          height: 36.h,
                          fit: BoxFit.cover,
                        ):Image.asset("lib/Images/login/默认头像.jpeg",width: 36.w,height: 36.h, fit: BoxFit.cover,),
                      ),
                    ),
                    SizedBox(width: 8.w,),
                    Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Text(widget.userMap['realName']!=null?widget.userMap['realName']:"货主",style: TextStyle(color: Colors.black,fontSize: 14.sp)),
                        Row(
                          children: [
                            Text("好评率低于",style: TextStyle(color: MyColors.hintColor,fontSize: 12.sp),),
                            Text("90%",style: TextStyle(color: MyColors.themeColor,fontSize: 12.sp),),
                            Text("将影响成交",style: TextStyle(color: MyColors.hintColor,fontSize: 12.sp),),
                          ],
                        )

                      ],
                    ),
                  ],
                ),
                SizedBox(height: 10.h,),
                Container(
                  height: 28.h,
                  color: Color.fromRGBO(251, 236, 228, 1),
                  child: Center(
                    child:Text("邀请对方评价，双方互评后，即可计入好评率计算",style: TextStyle(color: MyColors.themeColor,fontSize: 12.sp),),
                  ),
                ),
                SizedBox(height: 10.h,),
              ],
            ),
          ),
          SizedBox(height: 8.h,),
          Container(
            color: Colors.white,
            padding: EdgeInsets.only(left: 8.w,right: 8.w,top: 10.h,bottom: 10.h),
            child: Row(
              children: [
                Column(
                  children: [
                    Row(
                      crossAxisAlignment: CrossAxisAlignment.end,
                      children: [
                        Text(widget.userMap['rating']!=null?widget.userMap['rating'].toString():"--",style: TextStyle(color: MyColors.themeColor,fontSize: 36.sp),),
                        Text("%",style: TextStyle(color: MyColors.themeColor,fontSize: 14.sp),),
                      ],
                    ),
                    SizedBox(height: 8.h,),
                    Text("近一年好评率",style: TextStyle(color: Colors.black,fontSize: 12.sp),),
                  ],
                ),
                SizedBox(width: 8.w,),
                Column(
                  children: [
                    Row(
                      children: [
                        Text("好评",style: TextStyle(color: Colors.black,fontSize: 12.sp),),
                        SizedBox(width: 8.w,),
                        Container(
                          width: 180.w,
                          height: 8.h,
                          decoration: BoxDecoration(
                            gradient: LinearGradient(
                              begin: Alignment.centerLeft,
                              end: Alignment.centerRight,
                              colors: [MyColors.themeColor, MyColors.themeColor, Color.fromRGBO(239, 239, 239, 1)],
                              stops: [0.0, widget.userMap['positiveNum']/widget.userMap['totalNum'], 0.0],
                            ),
                            borderRadius: BorderRadius.all(Radius.circular(10)),
                          ),
                        ),
                        SizedBox(width: 8.w,),
                        Text(widget.userMap['positiveNum'].toString(),style: TextStyle(color: MyColors.hintColor,fontSize: 12.sp),),
                      ],
                    ),
                    SizedBox(height: 8.h,),
                    Row(
                      children: [
                        Text("中评",style: TextStyle(color: Colors.black,fontSize: 12.sp),),
                        SizedBox(width: 8.w,),
                        Container(
                          width: 180.w,
                          height: 8.h,
                          decoration: BoxDecoration(
                            gradient: LinearGradient(
                              begin: Alignment.centerLeft,
                              end: Alignment.centerRight,
                              colors: [MyColors.themeColor, MyColors.themeColor, Color.fromRGBO(239, 239, 239, 1)],
                              stops: [0.0, widget.userMap['neutralNum']/widget.userMap['totalNum'], 0.0],
                            ),
                            borderRadius: BorderRadius.all(Radius.circular(10)),
                          ),
                        ),
                        SizedBox(width: 8.w,),
                        Text(widget.userMap['neutralNum'].toString(),style: TextStyle(color: MyColors.hintColor,fontSize: 12.sp),),
                      ],
                    ),
                    SizedBox(height: 8.h,),
                    Row(
                      children: [
                        Text("差评",style: TextStyle(color: Colors.black,fontSize: 12.sp),),
                        SizedBox(width: 8.w,),
                        Container(
                          width: 180.w,
                          height: 8.h,
                          decoration: BoxDecoration(
                            gradient: LinearGradient(
                              begin: Alignment.centerLeft,
                              end: Alignment.centerRight,
                              colors: [MyColors.themeColor, MyColors.themeColor, Color.fromRGBO(239, 239, 239, 1)],
                              stops: [0.0,  widget.userMap['negativeNum']/widget.userMap['totalNum'], 0.0],
                            ),
                            borderRadius: BorderRadius.all(Radius.circular(10)),
                          ),
                        ),
                        SizedBox(width: 8.w,),
                        Text(widget.userMap['negativeNum'].toString(),style: TextStyle(color: MyColors.hintColor,fontSize: 12.sp),),
                      ],
                    ),

                  ],
                )
              ],
            ),

          ),
          SizedBox(height: 8.h,),
          Container(
            color: Colors.white,
            padding: EdgeInsets.only(top: 10.h,bottom: 10.h),
            child:Column(
              children: [
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    SizedBox(),
                    Column(
                      children: [
                        TextButton(onPressed: (){
                          setState(() {
                            isCheck=0;
                            dataList=[];
                            getUnEvaluationAct();
                          });
                        },
                          child:  Row(
                            children: [
                              Text("待评价",style: TextStyle (fontWeight:isCheck==0? FontWeight.w600:FontWeight.w300,color:Colors.black,fontSize: isCheck==0?14.sp:12.sp),),
                              // Badge(label: Text("1"),),
                            ],
                          ),
                        ),
                        Container(height: 2.h,width: 27.w,color:isCheck==0?Color.fromRGBO(231, 112, 27, 0.85) : Colors.white,),
                      ],
                    ),
                    Column(
                      children: [
                        TextButton(onPressed: (){
                          setState(() {
                            isCheck=1;
                            dataList=[];
                            getMyEvaluationAct();
                          });
                        }, child:
                        Row(
                          children: [
                            Text("收到的评价",style: TextStyle (fontWeight:isCheck==1? FontWeight.w600:FontWeight.w300,color:Colors.black,fontSize: isCheck==1?14.sp:12.sp),),
                            // Badge(label: Text("1"),),
                          ],
                        ),
                        ),
                        Container(height: 2.h,width: 27.w,color:isCheck==1?Color.fromRGBO(231, 112, 27, 0.85) : Colors.white,),
                      ],
                    ),
                    Column(
                      children: [
                        TextButton(onPressed: (){
                          setState(() {
                            isCheck=2;
                            dataList=[];
                            getShipperEvaluationAct();
                          });
                        }, child:
                        Row(
                          children: [
                            Text("发表的评价",style: TextStyle (fontWeight:isCheck==2? FontWeight.w600:FontWeight.w300,color:Colors.black,fontSize: isCheck==2?14.sp:12.sp),),
                            // Badge(label: Text("1"),),
                          ],
                        ),
                        ),
                        Container(height: 2.h,width: 27.w,color:isCheck==2?Color.fromRGBO(231, 112, 27, 0.85) : Colors.white,),
                      ],
                    ),
                    SizedBox(),

                  ],
                ),
                Container(
                  height: 1.h,
                  color: MyColors.backgreyColor,
                ),
                SizedBox(height: 3.h,),
                isCheck==0?
                Container(
                  height: 28.h,
                  color: Color.fromRGBO(251, 236, 228, 1),
                  child: Center(
                    child:Text("您的真实评价将帮助广大司机筛选好货主",style: TextStyle(color: MyColors.themeColor,fontSize: 12.sp),),
                  ),
                ):

                Container(
                    margin: EdgeInsets.only(top: 1.h),
                    padding: EdgeInsets.only(left: 15.w,top: 10.h,bottom: 10.h,right: 15.w),
                    color: Colors.white,
                    child: Column(
                        children: [
                          BrnSelectTag(
                              tags: tagList,
                              spacing: 4.w,
                              tagWidth: 60.w,
                              selectedTagBackgroundColor:Color.fromRGBO(231, 112, 27, 0.85),
                              tagTextStyle:TextStyle(color: Colors.black,fontSize:12.sp ),
                              selectedTagTextStyle:TextStyle(color: MyColors.themeColor,fontSize:12.sp ),
                              initTagState: [true],
                              onSelect: (selectedIndexes) {
                                setState(() {
                                  myEvaTag=int.parse(selectedIndexes.toString().replaceAll("[", "").replaceAll("]", ""));
                                  if(myEvaTag==0) {
                                    pageNum = 1;
                                    if(isCheck==1) {
                                      getMyEvaluationAct();
                                    }else{
                                      getShipperEvaluationAct();
                                    }
                                  }
                                  if(myEvaTag==1) {
                                    pageNum = 1;
                                    if(isCheck==1) {
                                      getMyEvaluationAct();
                                    }else{
                                      getShipperEvaluationAct();
                                    }
                                  }
                                  if(myEvaTag==2) {
                                    pageNum = 1;
                                    if(isCheck==1) {
                                      getMyEvaluationAct();
                                    }else{
                                      getShipperEvaluationAct();
                                    }
                                  }
                                  if(myEvaTag==3) {
                                    pageNum = 1;
                                    if(isCheck==1) {
                                      getMyEvaluationAct();
                                    }else{
                                      getShipperEvaluationAct();
                                    }
                                  }
                                });
                              }),
                        ]
                    )
                ),
                EasyRefresh(
                  header:
                  ClassicHeader(
                    dragText: '下拉刷新',
                    armedText: '准备释放',
                    readyText: '加载中...',
                    processingText: '加载中...',
                    processedText: '刷新成功',
                    noMoreText: '暂无更多',
                    failedText: '刷新失败',
                    messageText: '刷新时间 %T',
                  ),
                  footer: ClassicFooter(
                    dragText: '加载更多',
                    armedText: '准备释放',
                    readyText: '加载中...',
                    processingText: '加载中...',
                    processedText: '加载成功',
                    noMoreText: '暂无更多',
                    failedText: '加载失败',
                    messageText: '加载时间 %T',
                  ),
                  onRefresh: _onRefresh,
                  onLoad: dataList.length>19?onReachBottom:null,
                  child:
                  isCheck==0?
                  Container(
                    margin: EdgeInsets.only(top: 1.h),
                    height: screenSize.height-400.h,
                    child:ListView.builder(
                      // physics: NeverScrollableScrollPhysics(),
                        itemCount:dataList.length,
                        itemBuilder: (BuildContext context, int index) {
                          return GestureDetector(
                            child: Container(
                              color: Colors.white,
                              padding: EdgeInsets.only(top: 15.h,left: 15.w,right: 15.w),
                              child:Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                  Row(
                                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                    children: [
                                      Row(
                                        crossAxisAlignment: CrossAxisAlignment.center,
                                        children: [
                                          Column(
                                            children: [
                                              Image.asset("lib/Images/OrderList/装icon.png",width:15.w ,height:15.h,),
                                              Image.asset("lib/Images/OrderList/垂直虚线.png",width:13.w ,height:10.h,),
                                              if(dataList[index]['goodsInfo']['loadPlaceInfo'].length==2)
                                                Column(
                                                  crossAxisAlignment: CrossAxisAlignment.start,
                                                  children: [
                                                    Image.asset("lib/Images/OrderList/装icon.png",width:15.w ,height:15.h,),
                                                    Image.asset("lib/Images/OrderList/垂直虚线.png",width:10.w ,height:10.h,),
                                                  ],
                                                ),
                                              if(dataList[index]['goodsInfo']['unloadPlaceInfo'].length==2)
                                                Column(
                                                  children: [
                                                    Image.asset("lib/Images/OrderList/卸icon.png",width:15.w ,height:15.h,),
                                                    Image.asset("lib/Images/OrderList/垂直虚线.png",width:10.w ,height:10.h,),
                                                  ],
                                                ),
                                              Image.asset("lib/Images/OrderList/卸icon.png",width:15.w ,height:15.h,),
                                            ],
                                          ),
                                          SizedBox(width: 4.w,),
                                          Column(
                                            crossAxisAlignment: CrossAxisAlignment.start,
                                            children: [

                                              Row(
                                                children: [
                                                  Container(
                                                    constraints: BoxConstraints(
                                                      maxWidth:170.w, // 限制文本最大宽度
                                                    ),
                                                    child:
                                                    Text(dataList[index]['goodsInfo']['loadPlaceInfo'][0]['city']+" "+dataList[index]['goodsInfo']['loadPlaceInfo'][0]['county'],style: TextStyle(color: Colors.black,overflow: TextOverflow.ellipsis,fontSize: 14.sp,fontWeight: FontWeight.w600),),
                                                  ),
                                                ],
                                              ),
                                              if(dataList[index]['goodsInfo']['loadPlaceInfo'].length==2)
                                                Column(
                                                  crossAxisAlignment: CrossAxisAlignment.start,
                                                  children: [
                                                    Container(
                                                      constraints: BoxConstraints(
                                                        maxWidth:170.w, // 限制文本最大宽度
                                                      ),
                                                      child:Text(dataList[index]['goodsInfo']['loadPlaceInfo'][1]['city']+" "+dataList[index]['goodsInfo']['loadPlaceInfo'][1]['county'],style: TextStyle(color: Colors.black,fontSize: 14.sp,fontWeight: FontWeight.w600),overflow: TextOverflow.ellipsis,),

                                                    ),
                                                  ],
                                                ),
                                              SizedBox(height:8.h,),
                                              if(dataList[index]['goodsInfo']['unloadPlaceInfo'].length==2)
                                                Column(
                                                  crossAxisAlignment: CrossAxisAlignment.start,
                                                  children: [
                                                    Container(
                                                      constraints: BoxConstraints(
                                                        maxWidth:170.w, // 限制文本最大宽度
                                                      ),
                                                      child: Text(dataList[index]['goodsInfo']['unloadPlaceInfo'][0]['city']+" "+dataList[index]['goodsInfo']['unloadPlaceInfo'][0]['county'],style: TextStyle(color: Colors.black,fontSize: 14.sp,fontWeight: FontWeight.w600),overflow: TextOverflow.ellipsis,),

                                                    ),


                                                    SizedBox(height:8.h,),
                                                  ],
                                                ),
                                              Row(
                                                children:[
                                                  dataList[index]['goodsInfo']['unloadPlaceInfo'].length==2?
                                                  Container(
                                                      constraints: BoxConstraints(
                                                        maxWidth:170.w, // 限制文本最大宽度
                                                      ),
                                                      child: Text(dataList[index]['goodsInfo']['unloadPlaceInfo'][1]['city']+" "+dataList[index]['goodsInfo']['unloadPlaceInfo'][1]['county'],style: TextStyle(color: Colors.black,fontSize: 14.sp,fontWeight: FontWeight.w600),overflow: TextOverflow.ellipsis,)
                                                  )
                                                      :
                                                  Container(
                                                    constraints: BoxConstraints(
                                                      maxWidth:170.w, // 限制文本最大宽度
                                                    ),
                                                    child:  Text(dataList[index]['goodsInfo']['unloadPlaceInfo'][0]['city']+" "+dataList[index]['goodsInfo']['unloadPlaceInfo'][0]['county'],style: TextStyle(color: Colors.black,fontSize: 14.sp,fontWeight: FontWeight.w600),overflow: TextOverflow.ellipsis,),
                                                  ),
                                                ],
                                              ),


                                            ],
                                          ),

                                        ],
                                      ),
                                      GestureDetector(
                                        child:BrnTagCustom.buildBorderTag(
                                          tagText: '评价货主',
                                          textColor: MyColors.themeColor,
                                          borderColor: MyColors.themeColor,
                                          borderWidth: 1,
                                          fontSize: 14.sp,
                                          textPadding: EdgeInsets.all(3),
                                          tagBorderRadius: BorderRadius.all( Radius.circular(30)),
                                        ) ,
                                        onTap: (){
                                          Navigator.push( context, FadeRoute(page:EvaluationPage(dataMap: dataList[index],)));
                                        },
                                      ),

                                    ],
                                  ),

                                  SizedBox(height: 8.h,),
                                  Column(
                                    crossAxisAlignment: CrossAxisAlignment.start,
                                    children: [
                                      Container(
                                        child: Text(dataList[index]['shipperInfo']['realName']+"丨"+dataList[index]['goodsInfo']['cargoInfo'][0]['cargoName'],style: TextStyle(color: MyColors.textColor,fontSize: 12.sp),),
                                      ),
                                      Container(
                                        child: Text("下单时间"+dataList[index]['createTime'],style: TextStyle(color: MyColors.textColor,fontSize: 12.sp),),
                                      ),
                                    ],
                                  ),
                                  SizedBox(height: 10.h,),
                                  Divider(height: 1.h,color: MyColors.backgreyColor,),
                                ],
                              ),

                            ) ,
                            onTap: (){
                              Navigator.push( context, FadeRoute(page:EvaluationPage(dataMap: dataList[index],)));
                            },
                          )
                          ;} ),
                  ):
                  Container(
                    margin: EdgeInsets.only(top: 1.h),
                    height: screenSize.height-400.h,
                    child:ListView.builder(
                      // physics: NeverScrollableScrollPhysics(),
                        itemCount:dataList.length,
                        itemBuilder: (BuildContext context, int index) {
                          return GestureDetector(
                            child: Container(
                              color: Colors.white,
                              padding: EdgeInsets.only(top: 15.h,left: 15.w,right: 15.w),
                              child:Column(
                                children: [

                                  Row(
                                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                    children: [
                                      Row(
                                        children: [
                                          Container(
                                            width: screenSize.width-100.w,
                                            child:Text(dataList[index]['route'],maxLines: 1,style: TextStyle(color: MyColors.textColor,fontSize: 14.sp,fontWeight: FontWeight.w600, overflow:TextOverflow.ellipsis,),),

                                          )
                                        ],
                                      ),

                                      if(myEvaTag==1)
                                        Image.asset("lib/Images/PersonCenter/我的评价好评.png",width: 57.w,height: 20.h,),
                                      if(myEvaTag==2)
                                        Image.asset("lib/Images/PersonCenter/我的评价中评.png",width: 57.w,height: 20.h,),
                                      if(myEvaTag==3)
                                        Image.asset("lib/Images/PersonCenter/我的评价差评.png",width: 57.w,height: 20.h,),
                                      if(myEvaTag==0)
                                        dataList[index]['level']=="POSITIVE"? Image.asset("lib/Images/PersonCenter/我的评价好评.png",width: 57.w,height: 20.h,)
                                            :dataList[index]['level']=="NEUTRAL"?Image.asset("lib/Images/PersonCenter/我的评价中评.png",width: 57.w,height: 20.h,)
                                            :Image.asset("lib/Images/PersonCenter/我的评价差评.png",width: 57.w,height: 20.h,),

                                    ],
                                  ),
                                  SizedBox(height: 8.h,),
                                  Row(
                                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                    crossAxisAlignment: CrossAxisAlignment.start,
                                    children: [
                                      dataList[index]['tags']!=null?
                                      Container(
                                        width: screenSize.width - 200.w,
                                        child: Wrap(
                                          spacing:4.w, // 两个Container之间的水平间距
                                          runSpacing: 4.h, // 行与行之间的垂直间距
                                          children: List<Widget>.from(dataList[index]['tags'].map((length) {
                                            return Container(
                                              width: 75.w, // Container宽度
                                              height: 20.h, // Container高度，使其成为正方形
                                              decoration: BoxDecoration(
                                                border: Border.all(
                                                  color: MyColors.hintColor, // 边框颜色
                                                  width: 0.5, // 边框宽度
                                                ),
                                                color: Colors.white, // 根据状态决定颜色
                                                borderRadius: BorderRadius.circular(3.0), // 设置Container的圆角
                                              ),
                                              child: Center(
                                                child: Text(
                                                  length,
                                                  maxLines: 1,
                                                  style: TextStyle(
                                                    overflow: TextOverflow.ellipsis,
                                                    fontSize: 10.sp,
                                                    color: MyColors.authTipColor, // 文字颜色为白色
                                                  ),
                                                ),
                                              ),
                                            );
                                          })),
                                        ),
                                      ):SizedBox(),

                                      Container(
                                        width: 130.w,
                                        child: Text(dataList[index]['createTime'].substring(0, 10)+"发表评论",style: TextStyle(color: MyColors.authTipColor,fontSize: 12.sp),),
                                      ),
                                    ],
                                  ),


                                  SizedBox(height: 10.h,),
                                  Divider(height: 1.h,color: MyColors.backgreyColor,),
                                ],
                              ),

                            ) ,
                            onTap: (){
                              // Navigator.push( context, FadeRoute(page:EvaluationDetails(dataMap: dataList[index],)));
                            },
                          )
                          ;} ),
                  ),
                ),

              ],
            ),
          )
        ],
      ),
    );
  }


}

